{% extends 'base.html.twig' %}

{% block title %}Hello AvisController!{% endblock %}

{% block body %}
<style>
    .example-wrapper { margin: 1em auto; max-width: 800px; width: 95%; font: 18px/1.5 sans-serif; }
    .example-wrapper code { background: #F5F5F5; padding: 2px 6px; }
</style>
<div class="titre-Accueil">
<h1>Avis</h1>
</div>
{% if app.user and is_granted('ROLE_USER') and not is_granted('ROLE_ADMIN') %}
<div class='posterAvis'>
<form method="POST" action="/avis/form">
    <input type="submit" value="Poster un avis">
</form>
</div>
{% endif %}

{% for avs in avis %}
<section class="avis">
    <p class="nom">{{avs.idUtilisateurAvis.identifiant}}</p>
    <p>{{avs.messageavis}}</p>
</section>
{% endfor %}
{% endblock %}
